#更新yum版本
yum update -y

# 安装需要的软件包
yum install -y yum-utils device-mapper-persistent-data lvm2

# 设置yum源 选择阿里云的仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# 选择docker版本安装 docker-ce-18.03.1.ce
yum install docker-ce-18.03.1.ce -y

# 配置镜像加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://h3exari1.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload

# 启动Docker
systemctl start docker

# 查看docker版本
docker version

# 设置 docker 镜像
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io

# 启动Docker
systemctl start docker